package com.woniu.micropropertyserver.feign.controller;

import com.woniu.microcommonsserver.param.ResponseMsg;
import com.woniu.micropropertyserver.feign.service.MicroUserServerFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：bb
 * @date ：Created in 2021/2/3 0003
 * @description：
 * @modified By：
 * @version: $
 */
@RequestMapping("/userFeign")
@RestController
public class FeignUserController {

    @Autowired
    private MicroUserServerFeign microUserServerFeign;


    @GetMapping(value="/name",produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseMsg findByName(String loginName){
        ResponseMsg str = microUserServerFeign.searchOnebyLoginName(loginName);
        return str;
    }

    @GetMapping(value="/uid",produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseMsg findById(Integer uid){
        ResponseMsg str = microUserServerFeign.searchOnebyUid(uid);
        return str;
    }

    @GetMapping(value="/Pros",produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseMsg findPros(){
        ResponseMsg str = microUserServerFeign.findPros();
        return str;
    }
}
